package com.tensquare.search.dao.pojo;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

@Document(indexName = "tensquare", type = "article") // 指定索引名, 类型
public class Article implements Serializable {

    @Id
    private String id;

    @Field(
            type = FieldType.text,
            index = true,
            analyzer = "ik_smart",
            //进行字段分词搜索的时候，使用的分词器
            searchAnalyzer = "ik_smart")
    private String title; // 标题

    @Field(
            type = FieldType.text,
            index = true,
            analyzer = "ik_smart",
            //进行字段分词搜索的时候，使用的分词器
            searchAnalyzer = "ik_smart")
    private String content;
    private String state;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }
}
